package com.epfresh.supplier.adapter;

import android.content.Context;
import android.content.SharedPreferences;
import android.graphics.Paint;
import android.text.Html;
import android.view.LayoutInflater;
import android.view.View;
import android.view.ViewGroup;
import android.widget.AdapterView;
import android.widget.BaseExpandableListAdapter;
import android.widget.ExpandableListView;
import android.widget.ImageView;
import android.widget.TextView;

import com.epfresh.api.dialog.UpGoodsTipsDialog;
import com.epfresh.api.global.BaseApplication;
import com.epfresh.api.helper.ApplicationHelper;
import com.epfresh.api.universalimageloader.core.ImageLoader;
import com.epfresh.api.utils.T;
import com.epfresh.supplier.R;
import com.epfresh.supplier.activity.ProductActivity;
import com.epfresh.supplier.entity.ProductConfigs;
import com.epfresh.supplier.entity.Promotion;

import java.util.List;

/**
 * Created by wzh on 2016/5/6.
 */
public class SoldListAdapter extends BaseExpandableListAdapter implements View.OnClickListener {

    public Context context;
    ExpandableListView lv;
    public List<ProductConfigs> groupList;

    public boolean isDc;

    public int type;

    private AdapterView.OnItemClickListener onItemClickListener;
    private OnBottomClickListener onBottomClickListener;
    private OnNotifyDataSetChangedListener onNotifyDataSetChangedListener;

    public SoldListAdapter(Context context, List<ProductConfigs> groupList, ExpandableListView lv) {
        this.context = context;
        this.groupList = groupList;
        this.lv = lv;
    }

    public int getCurrentIndex(){
        Context activity = context;
        if (activity != null && activity instanceof ProductActivity){
            return ((ProductActivity)activity).getCurrentIndex();
        }
        return -1;
    }

    public int getType() {
        return type;
    }

    public void setType(int type) {
        this.type = type;
    }

    public boolean isDc() {
        return isDc;
    }

    public void setDc(boolean dc) {
        isDc = dc;
    }

    @Override
    public void notifyDataSetChanged() {
        if (onNotifyDataSetChangedListener != null) {
            onNotifyDataSetChangedListener.OnNotifyDataSetChangedListener(groupList.size());
        }
        expendList();
        super.notifyDataSetChanged();
    }

    public OnNotifyDataSetChangedListener getOnNotifyDataSetChangedListener() {
        return onNotifyDataSetChangedListener;
    }

    public void setOnNotifyDataSetChangedListener(OnNotifyDataSetChangedListener onNotifyDataSetChangedListener) {
        this.onNotifyDataSetChangedListener = onNotifyDataSetChangedListener;
    }

    public OnBottomClickListener getOnBottomClickListener() {
        return onBottomClickListener;
    }

    public void setOnBottomClickListener(OnBottomClickListener onBottomClickListener) {
        this.onBottomClickListener = onBottomClickListener;
    }


   /* @Override
    public int getCount() {
        return groupList == null ? 0 : groupList.size();
    }

    @Override
    public Object getItem(int i) {
        return i;
    }

    @Override
    public long getItemId(int i) {
        return i;
    }*/


//    public View getView(int groupPosition, View convertView, ViewGroup viewGroup) {
//
//    }


    @Override
    public void onClick(View v) {


        Object tag = v.getTag(R.id.item_key_position);
        if (tag != null && tag instanceof Integer) {
            int position = (int) tag;
            int type = 0;
            switch (v.getId()) {
                case R.id.ll_sold_up:
//                case R.id.tv_sold_up:
                    if (BaseApplication.getInstance().getMerchant().isAuthNeedBind()) {
                        T.toast("暂无权限");
                    }else {
                        type = 0;
                        if (onBottomClickListener != null) {
                            onBottomClickListener.onBottomClickListener(position, type);
                        }
                    }
                    break;
                case R.id.ll_edit:
//                case R.id.tv_edit:
                    if (BaseApplication.getInstance().getMerchant().isAuthNeedBind()) {
                        T.toast("暂无权限");
                    }else {
                        type = 1;
                        if (onBottomClickListener != null) {
                            onBottomClickListener.onBottomClickListener(position, type);
                        }
                    }
                    break;
                case R.id.ll_promotion:
//                case R.id.tv_edit:
                    type = 1;
                    if (onBottomClickListener != null) {
                        onBottomClickListener.onBottomClickListener(position, type);
                    }
                    break;
                case R.id.ll_edit_price:
//                case R.id.tv_edit_price:
                    type = 2;
                    if (onBottomClickListener != null) {
                        onBottomClickListener.onBottomClickListener(position, type);
                    }
                    break;
                case R.id.rl_detail:
                    if (onBottomClickListener != null) {
                        onBottomClickListener.onBottomClickListener(position, 3);
                    }
                    break;
                case R.id.rl_expend:
                    if (onBottomClickListener != null) {
                        onBottomClickListener.onBottomClickListener(position, 4);
                    }
                    break;
                case R.id.ll_stock:
                    if (onBottomClickListener != null) {
                        onBottomClickListener.onBottomClickListener(position, 6);
                    }
                    break;
                case R.id.ll_delete:

                    if (BaseApplication.getInstance().getMerchant().isAuthNeedBind()) {
                        T.toast("暂无权限");
                    }else {
                        if (onBottomClickListener != null) {
                            onBottomClickListener.onBottomClickListener(position, 7);
                        }
                    }
                    break;
                case R.id.rl_body:

                    if (onBottomClickListener != null) {
                        onBottomClickListener.onBottomClickListener(position, 8);
                    }
                    break;
                case R.id.iv_up_goods:

                    if (onBottomClickListener != null) {
                        onBottomClickListener.onBottomClickListener(position, 9);
                    }
                    break;
                case R.id.tv_finish:
                    if (BaseApplication.getInstance().getMerchant().isAuthNeedBind()) {
                        T.toast("暂无权限");
                    }else {
                        tag = v.getTag(R.id.item_key_status);
                        if (tag != null && tag instanceof Integer) {
                            int childPosition = (int) tag;
                            Object child = getChild(position, childPosition);

                            if (child != null && child instanceof Promotion && onChildClickListener != null) {
                                onChildClickListener.onChildClickListener(position, childPosition, (Promotion) child, 0);
                            }
                        }
                    }
                    break;
                case R.id.v_content:

                    if (BaseApplication.getInstance().getMerchant().isAuthNeedBind()) {
                        T.toast("暂无权限");
                    }else {
                        tag = v.getTag(R.id.item_key_status);
                        if (tag != null && tag instanceof Integer) {
                            int childPosition = (int) tag;
                            Object child = getChild(position, childPosition);
                            if (child != null && child instanceof Promotion && onChildClickListener != null) {
                                onChildClickListener.onChildClickListener(position, childPosition, (Promotion) child, 1);
                            }
                        }
                    }
                    break;
            }


        }
    }

    @Override
    public int getGroupCount() {
        return groupList == null ? 0 : groupList.size();
    }

    protected void expendList() {

        if (lv != null)
            for (int i = 0; i < groupList.size(); i++) {
                lv.expandGroup(i);
            }
    }

    @Override
    public int getChildrenCount(int groupPosition) {
        if (groupList != null && groupPosition < groupList.size()){
            ProductConfigs pc = groupList.get(groupPosition);
            if (pc != null){
                List<Promotion> saleDiscount = pc.getPromotion();
                if (saleDiscount != null){
                    return saleDiscount.size();
                }
            }
        }
        return 0;
    }

    @Override
    public Object getGroup(int groupPosition) {
        if (groupList != null && groupPosition < groupList.size()){
            ProductConfigs pc = groupList.get(groupPosition);
            return pc;
        }
        return null;
    }

    @Override
    public Object getChild(int groupPosition, int childPosition) {
        if (groupList != null && groupPosition < groupList.size()){
            ProductConfigs pc = groupList.get(groupPosition);
            if (pc != null){
                List<Promotion> saleDiscount = pc.getPromotion();
                if (saleDiscount != null && childPosition < saleDiscount.size()){
                    return saleDiscount.get(childPosition);
                }
            }
        }

        return null;
    }

    @Override
    public long getGroupId(int groupPosition) {
        return groupPosition;
    }

    @Override
    public long getChildId(int groupPosition, int childPosition) {
        return childPosition;
    }

    @Override
    public boolean hasStableIds() {
        return true;
    }

    @Override
    public View getGroupView(int groupPosition, boolean isExpanded, View convertView, ViewGroup parent) {
        ViewHolder vh = null;
        if (convertView == null) {
            vh = new ViewHolder();
            convertView = LayoutInflater.from(context).inflate(R.layout.item_product_sold, null, false);
            //图片
            vh.iv = (ImageView) convertView.findViewById(R.id.iv_pic);
            vh.tvTitle = (TextView) convertView.findViewById(R.id.tv_title);
            vh.tvType = (TextView) convertView.findViewById(R.id.tv_type);


            vh.tvUp = (TextView) convertView.findViewById(R.id.tv_sold_up);
            vh.tvEdit = (TextView) convertView.findViewById(R.id.tv_edit);
            vh.tvPrice = (TextView) convertView.findViewById(R.id.tv_price);

            vh.ivSold = (ImageView) convertView.findViewById(R.id.iv_sold_up);
            vh.ivArrow = (ImageView) convertView.findViewById(R.id.iv_arrow);
            vh.ivFrozen = (ImageView) convertView.findViewById(R.id.iv_frozen);
            vh.rlBottom = convertView.findViewById(R.id.rl_bottom);


            vh.rlPrice = convertView.findViewById(R.id.ll_edit_price);
            vh.rlEdit = convertView.findViewById(R.id.ll_edit);
            vh.rlUp = convertView.findViewById(R.id.ll_sold_up);
            vh.rlStock = convertView.findViewById(R.id.ll_stock);
            vh.rlDelete = convertView.findViewById(R.id.ll_delete);
            vh.rlBody = convertView.findViewById(R.id.rl_body);
            vh.rlPromotion = convertView.findViewById(R.id.ll_promotion);


            //库存
            vh.tvInventory = (TextView) convertView.findViewById(R.id.tv_inventory);
            vh.tvInventoryTight = (TextView) convertView.findViewById(R.id.tv_inventory_tight);
            vh.tvBottomTitle = (TextView) convertView.findViewById(R.id.tv_bottom_title);
            //起订量和单位
            vh.tvMid = (TextView) convertView.findViewById(R.id.tv_mid);
            vh.ivChildGoods = (ImageView) convertView.findViewById(R.id.iv_up_goods);
            vh.vTipArea =  convertView.findViewById(R.id.v_up_goods);
            vh.vTipsLine = convertView.findViewById(R.id.v_up);

            convertView.setTag(vh);
        } else {
            vh = (ViewHolder) convertView.getTag();
        }


        ProductConfigs data = groupList.get(groupPosition);


        ImageLoader.getInstance().displayImage(data.getThumbnail(), vh.iv);

        ProductConfigs productConfigs = groupList.get(groupPosition);

        vh.rlBody.setTag(R.id.item_key_position, groupPosition);
        vh.rlBody.setOnClickListener(this);
        vh.rlPromotion.setTag(R.id.item_key_position, groupPosition);
        vh.rlPromotion.setOnClickListener(this);
        vh.rlBottom.setVisibility(View.VISIBLE);

        int type = productConfigs.getType();
        int status = productConfigs.getStatus();
        //    (0, "草稿"),
        //    (1, "已上架"),
        //    (2, "未上架"),
        //    (4, "审核中")
        if (status == 1) {//上架产品
            vh.ivSold.setImageResource(R.mipmap.sold_down);
            vh.tvUp.setText(R.string.sold_down);
        } else {
            vh.ivSold.setImageResource(R.mipmap.sold_up);
            vh.tvUp.setText(R.string.sold_up);
        }
        vh.ivFrozen.setVisibility(View.GONE);
        vh.rlStock.setVisibility(View.GONE);
        vh.rlDelete.setVisibility(View.VISIBLE);
        vh.rlPromotion.setVisibility(View.GONE);
        if (type ==2){
            if ((status == 0 || status == 2)){

            }else {
                vh.rlBody.setOnClickListener(null);
            }
        }
        if (status == 4) {
            vh.rlPrice.setVisibility(View.GONE);
            vh.rlUp.setVisibility(View.GONE);
            vh.rlEdit.setVisibility(View.GONE);
            vh.ivFrozen.setVisibility(View.VISIBLE);
            vh.ivFrozen.setImageResource(R.mipmap.time_wait);
            vh.rlDelete.setVisibility(View.GONE);
            vh.tvBottomTitle.setText("审核中");
        } else if (status == 0) {
            vh.rlPrice.setVisibility(View.VISIBLE);
            vh.rlUp.setVisibility(View.VISIBLE);
            vh.rlEdit.setVisibility(View.VISIBLE);
            vh.tvBottomTitle.setText("草稿");
            if (type == 2) {//预售
                vh.rlPrice.setVisibility(View.GONE);
            } else {
                vh.rlPrice.setVisibility(View.VISIBLE);
            }

        } else if (status == 1) {
            vh.rlUp.setVisibility(View.VISIBLE);

            vh.rlDelete.setVisibility(View.GONE);
            vh.rlStock.setVisibility(View.VISIBLE);
            if (type == 2) {//预售
                String deliveryTime = productConfigs.getDeliveryTime();
                vh.tvBottomTitle.setText("预计"+deliveryTime+"到货");
                vh.rlPrice.setVisibility(View.GONE);
                vh.rlEdit.setVisibility(View.GONE);
//                vh.rlEdit.setVisibility(View.VISIBLE);
                vh.rlPromotion.setVisibility(View.VISIBLE);
            } else {
                vh.tvBottomTitle.setText("");
                vh.rlPrice.setVisibility(View.VISIBLE);
                vh.rlEdit.setVisibility(View.VISIBLE);
            }
        } else if (status == 2) {
            vh.rlPrice.setVisibility(View.VISIBLE);
            vh.rlUp.setVisibility(View.VISIBLE);
            vh.rlEdit.setVisibility(View.VISIBLE);
            if (type == 2) {//预售
                vh.rlPrice.setVisibility(View.GONE);
                vh.rlEdit.setVisibility(View.GONE);
                if (productConfigs.isRefuseStatus()){
                    vh.rlUp.setVisibility(View.GONE);
                    vh.ivFrozen.setVisibility(View.VISIBLE);
                    vh.ivFrozen.setImageResource(R.mipmap.address_noopen);
                    vh.tvBottomTitle.setText("审核失败");
                }else {
                    String deliveryTime = productConfigs.getDeliveryTime();
                    vh.tvBottomTitle.setText("预计" + deliveryTime + "到货");
                }
            } else {
                vh.tvBottomTitle.setText("");
                vh.rlPrice.setVisibility(View.VISIBLE);
                vh.rlEdit.setVisibility(View.GONE);
            }
        } else if (status == 3) {//冻结
            vh.rlPrice.setVisibility(View.GONE);
            vh.rlUp.setVisibility(View.GONE);
            vh.rlEdit.setVisibility(View.GONE);
            vh.rlDelete.setVisibility(View.GONE);
            vh.ivFrozen.setVisibility(View.VISIBLE);
            vh.ivFrozen.setImageResource(R.mipmap.frozen_blocked);
            vh.tvBottomTitle.setText("冻结");
        }
        if (2 == data.getType()) {//预售
            vh.tvType.setVisibility(View.VISIBLE);
//            vh.tvType.setBackgroundResource(R.drawable.good_type_pre_bg);
//            vh.tvType.setTextColor(Color.parseColor("#43adea"));

            vh.rlStock.setVisibility(View.GONE);

            String html="<font color=\"#00ffffff\">【预售】</font>"+data.getTitle();
            vh.tvTitle.setText(Html.fromHtml(html));
        } else {//现售
            vh.tvType.setVisibility(View.GONE);
//            vh.tvType.setText("现");
//            vh.tvType.setBackgroundResource(R.drawable.good_type_bg);
//            vh.tvType.setTextColor(Color.parseColor("#f13d1a"));
            vh.tvTitle.setText(data.getTitle());
        }

        if (status == 0) {

        } else if (type == 1) {
            //现售

        } else {

        }

        vh.tvUp.setTag(R.id.item_key_position, groupPosition);
        vh.tvEdit.setTag(R.id.item_key_position, groupPosition);
        vh.tvPrice.setTag(R.id.item_key_position, groupPosition);


//            vh.tvUp.setOnClickListener(this);
//            vh.tvEdit.setOnClickListener(this);
//            vh.tvPrice.setOnClickListener(this);

        vh.rlPrice.setTag(R.id.item_key_position, groupPosition);
        vh.rlEdit.setTag(R.id.item_key_position, groupPosition);
        vh.rlUp.setTag(R.id.item_key_position, groupPosition);
        vh.rlStock.setTag(R.id.item_key_position, groupPosition);
        vh.rlDelete.setTag(R.id.item_key_position, groupPosition);


        vh.rlPrice.setOnClickListener(this);
        vh.rlEdit.setOnClickListener(this);
        vh.rlUp.setOnClickListener(this);
        vh.rlStock.setOnClickListener(this);
        vh.rlDelete.setOnClickListener(this);


        vh.tvPrice.setText(productConfigs.getPriceStr());

        String minStr = productConfigs.getMinStr();
        String packageStr = productConfigs.getPackageStr();
        if (minStr != null && minStr.length() > 0) {
            minStr = minStr + "    " + packageStr;
        }
        vh.tvMid.setText(minStr);
        vh.tvInventoryTight.setVisibility(View.GONE);

        String inventory = productConfigs.getInventory();

        String s = inventory + productConfigs.getUnitStr();
        if (s != null && !"".equals(s)) {
            s = "库存" + inventory /*+ productConfigs.getUnitStr()*/;
        } else {
            s = "";
        }
        vh.tvInventory.setText(s);

        if (isDc){
            vh.tvInventory.setVisibility(View.INVISIBLE);
        }else {
            vh.tvInventory.setVisibility(View.VISIBLE);
        }

        if (type == 2) {//预售
            vh.rlEdit.setVisibility(View.GONE);
            vh.rlPromotion.setVisibility(View.GONE);
        }



/*        if (status == 1 *//*&& type == 1*//*) {
            vh.ivChildGoods.setVisibility(View.VISIBLE);
            vh.vTipsLine.setVisibility(View.VISIBLE);
            vh.vTipArea.setVisibility(View.VISIBLE);
            vh.ivChildGoods.setTag(R.id.item_key_position, groupPosition);
            vh.ivChildGoods.setTag(R.id.item_key_status, -1);
            vh.ivChildGoods.setOnClickListener(this);

            if (groupPosition == 0) {
                showTips();
            }
        }else {
            vh.ivChildGoods.setVisibility(View.GONE);
            vh.vTipsLine.setVisibility(View.GONE);
            vh.vTipArea.setVisibility(View.GONE);
            vh.ivChildGoods.setOnClickListener(null);
        }*/
        vh.rlStock.setVisibility(View.GONE);
        vh.rlPrice.setVisibility(View.GONE);
        return convertView;
    }

    UpGoodsTipsDialog upGoodsTipsDialog;

    public void showTips() {
        if (type != 1 || getCurrentIndex() != 0){
            return;
        }
        SharedPreferences sp = context.getSharedPreferences("tips_show_" + ApplicationHelper.getInstance().getUser().getAccountId()+"_"+ BaseApplication.getInstance().getMerchant().getStoreId(), Context.MODE_PRIVATE);
        if (0 == sp.getInt("tips_number", 0)) {
            SharedPreferences.Editor editor = sp.edit();
            editor.putInt("tips_number", 1);
            editor.commit();
            if (upGoodsTipsDialog == null)
                upGoodsTipsDialog = new UpGoodsTipsDialog(context);
            if (!upGoodsTipsDialog.isShowing())
                upGoodsTipsDialog.show();
        }
    }


    @Override
    public View getChildView(int groupPosition, int childPosition, boolean isLastChild, View convertView, ViewGroup parent) {

        ViewChildHolder vh = null;
        if (convertView == null) {
            convertView = LayoutInflater.from(context).inflate(R.layout.item_child_product_sold, null, false);

            vh = new ViewChildHolder();

            vh.tvFlag = (TextView) convertView.findViewById(R.id.tv_flag);
            vh.tvPriceUnit = (TextView) convertView.findViewById(R.id.tv_price_unit);
            vh.tvPriceO = (TextView) convertView.findViewById(R.id.tv_price_o);
            vh.tvTime = (TextView) convertView.findViewById(R.id.tv_time);
            vh.tvAmount = (TextView) convertView.findViewById(R.id.tv_amount);
            vh.tvLimit = (TextView) convertView.findViewById(R.id.tv_limit);
            vh.tvFinish = (TextView) convertView.findViewById(R.id.tv_finish);
            vh.tvFinishFlag = (ImageView) convertView.findViewById(R.id.tv_finish_flag);

            vh.vLine = convertView.findViewById(R.id.v_line_1);
            vh.vWhole = convertView.findViewById(R.id.v_content);

            vh.tvPriceO.getPaint().setFlags(Paint.STRIKE_THRU_TEXT_FLAG);
            convertView.setTag(vh);
        } else {
            vh = (ViewChildHolder) convertView.getTag();
        }
        vh.tvFinish.setTag(R.id.item_key_position, groupPosition);
        vh.tvFinish.setTag(R.id.item_key_status, childPosition);
        vh.tvFinish.setOnClickListener(this);

        vh.vWhole.setTag(R.id.item_key_position, groupPosition);
        vh.vWhole.setTag(R.id.item_key_status, childPosition);
        vh.vWhole.setOnClickListener(this);

        ProductConfigs pc = groupList.get(groupPosition);


        List<Promotion> promotionList = pc.getPromotion();


        Promotion promotion = promotionList.get(childPosition);

        String type = promotion.getType();

        if (childPosition != 0) {
            vh.vLine.setVisibility(View.INVISIBLE);
        } else {
            vh.vLine.setVisibility(View.VISIBLE);
        }

        String quantityPerAccount = promotion.getQuantityPerAccount();

        if (quantityPerAccount == null || "".equals(quantityPerAccount)){
            vh.tvLimit.setVisibility(View.INVISIBLE);
        }else {
            vh.tvLimit.setVisibility(View.VISIBLE);
        }
        //1促销2秒杀
        if ("1".equals(type)) {
            vh.tvFlag.setText("促销");
            vh.tvFlag.setBackgroundResource(R.drawable.promotion_bg);
            vh.tvLimit.setText("限购：" + quantityPerAccount + promotion.getChargeUnit() + "/天/人");

            vh.tvAmount.setText(promotion.getLimitStr());
        } else if ("2".equals(type)) {
            vh.tvFlag.setBackgroundResource(R.drawable.seckill_bg);
            vh.tvFlag.setText("秒杀");
            vh.tvLimit.setText("限购：" + quantityPerAccount + promotion.getChargeUnit() + "/场/人");
            vh.tvAmount.setText(promotion.getSecKillAmount());
        }
        vh.tvTime.setText(promotion.getPromotionTime());
        vh.tvPriceO.setText(promotion.getOriginalCost() + "元/" + promotion.getChargeUnit());
        vh.tvPriceUnit.setText(promotion.getPrice() + "元/" + promotion.getChargeUnit());

        vh.tvFinishFlag.setVisibility(View.GONE);

        return convertView;
    }

    @Override
    public boolean isChildSelectable(int groupPosition, int childPosition) {
        return false;
    }





    public class ViewHolder {


        ImageView iv;
        TextView tvTitle;
        TextView tvType;
        TextView tvInventory;
        TextView tvInventoryTight;
        TextView tvBottomTitle;


        TextView tvMid;
        View rlBottom;

        TextView tvUp;
        TextView tvEdit;
        TextView tvPrice;
        ImageView ivSold;
        ImageView ivArrow;
        ImageView ivFrozen;
        ImageView ivChildGoods;
        View rlDetail;
        View rlExpend;
        View rlPrice;
        View rlEdit;
        View rlUp;
        View rlStock;
        View rlDelete;
        View rlBody;
        View rlPromotion;
        View vTipsLine;
        View vTipArea;


    }

    public class ViewChildHolder {


        TextView tvFlag;
        TextView tvPriceUnit;
        TextView tvPriceO;
        TextView tvTime;
        TextView tvAmount;
        TextView tvLimit;
        TextView tvFinish;
        ImageView tvFinishFlag;
        ImageView ivChildGoods;
        View vLine;
        View vWhole;

    }

    OnChildClickListener onChildClickListener;

    public SoldListAdapter.OnChildClickListener getOnChildClickListener() {
        return onChildClickListener;
    }

    public void setOnChildClickListener(SoldListAdapter.OnChildClickListener onChildClickListener) {
        this.onChildClickListener = onChildClickListener;
    }

    public interface OnBottomClickListener {

        public void onBottomClickListener(int position, int type);
    }

    public interface OnChildClickListener {

        public void onChildClickListener(int position, int childPosition, Promotion promotion, int type);
    }

    public interface OnNotifyDataSetChangedListener {

        public void OnNotifyDataSetChangedListener(int size);
    }
}
